import java.util.Scanner;

public class StringBuilderDemo2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        System.out.println("请输入一个字符串：");
        String input = scanner.nextLine();
        //判断字符串是否为对称字符串，如abcba，用StringBuilder
        StringBuilder reversed = new StringBuilder(input).reverse();
        if (input.equals(reversed.toString())) {
            sb.append("该字符串是对称字符串：").append(input);
        } else {
            sb.append("该字符串不是对称字符串：").append(input);
        }
        System.out.println(sb);
        scanner.close();

    }
}
